# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=mycroft-plasmoid
pkgver=0_git20210201
pkgrel=1
_commit="70f84636da63b00d114747e440e4a15aa7d5b019"
pkgdesc="Plasma integration of different Mycroft AI services"
url="https://invent.kde.org/utilities/mycroft-plasmoid"
# ppc64le, s390x, armhf blocked by mycroft-gui
# riscv64 disabled due to missing rust in recursive dependency
arch="all !ppc64le !s390x !armhf !riscv64"
license="Apache-2.0 AND LGPL-2.0-or-later AND LicenseRef-KDE-Accepted-GPL"
depends="mycroft-gui"
makedepends="
	extra-cmake-modules
	ki18n-dev
	knotifications-dev
	plasma-framework-dev
	qt5-qtbase-dev
	qt5-qtdeclarative-dev
	qt5-qtwebsockets-dev
	samurai
	"
source="https://invent.kde.org/utilities/mycroft-plasmoid/-/archive/$_commit/mycroft-plasmoid-$_commit.tar.gz"
options="!check" # No tests
builddir="$srcdir/mycroft-plasmoid-$_commit"

provides="plasma-mycroft=$pkgver-r$pkgrel" # Backwards compatibility
replaces="plasma-mycroft" # Backwards compatibility

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build

	# Conflicts with mycroft-core and is unnecessary
	rm "$pkgdir"/etc/mycroft/mycroft.conf
}

sha512sums="4fc85294941ec07e852500e0cc12309f925d6fbb42be5057b9bc288428d9fc8b0cc90220c76910b4da177cf9e18d4971af0626865a718ddb3eb97abdf30f8e72  mycroft-plasmoid-70f84636da63b00d114747e440e4a15aa7d5b019.tar.gz"
